﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rappelz.GameServer
{
    public class GameObject : BaseObject
    {
// UserDefinedType:   iterator
// VTable         :     , Type:  *
// Function       :     public void GameObject::iterator::iterator(struct GameObject::iterator &)
// Function       :     public void GameObject::iterator::iterator(struct GameObject *)
// Function       :     public void iterator()
// Function       :     public void GameObject::iterator::~iterator()
// Function       :     public const struct GameObject::iterator & GameObject::iterator::operator=(struct GameObject::iterator &)
// Function       :     public const struct GameObject::iterator & operator=(struct GameObject *)
// Function       :     public struct GameObject * operator*()
// Function       :     public struct GameObject * get()
// Function       :     public void set(struct GameObject *)
// Data           :     this+0x4, Member, Type: struct GameObject *, m_pObject
// Function       :     public void __local_vftable_ctor_closure()
// Function       :     public void * __vecDelDtor(unsigned int)
// Function       :   public void GameObject(const struct GameObject &)
// Function       :   public void GameObject::GameObject()

        public static GameObject get(uint handle)
        {
            GameObject result = null;

//            v4 = s_Lock.baseclass_0.vfptr;
//            v4->Lock((ILock *)&s_Lock);
            if (handle != 0)
            {
                result = MemoryPool.getPtrFromId(handle);
                if (result != null)
                {
                    if (result.bIsDeleteRequested)
                        result = null;
                }
            }
//            v7 = s_Lock.baseclass_0.vfptr;
//            v7->UnLock((ILock *)&s_Lock);
            return result;
        }

        public static GameObject raw_get(uint handle)
        {
            GameObject result;

            if (handle != 0)
                result = MemoryPool.getPtrFromId(handle);
            else
                result = null;
            return result;
        }


        public virtual bool IsCreature() // 14
        {
            return false;
        }

        public virtual bool IsPlayer()  // 18h
        {
            return false;
        }

        public virtual bool IsMonster() // 1c
        {
            return false;
        }

        public virtual bool IsNPC()     // 20
        {
            return false;
        }

        public virtual bool IsItem()    // 24
        {
            return false;
        }

        public virtual bool IsSummon()
        {
            return false;
        }

        public virtual bool IsPet()
        {
            return false;
        }

        public virtual bool IsSkillProp()
        {
            return false;
        }

        public virtual bool IsFieldProp()
        {
            return false;
        }

        public virtual bool IsRoamer()
        {
            return false;
        }

        public virtual bool IsMovable()
        {
            return false;
        }

// Function       :   protected bool GameObject::IsDeleteable()
// Function       :   protected void GameObject::~GameObject()

        public int m_nRefCount;             //Data           :   this+0xB0, Member, Type: volatile int, 

    }
}
